package net.findkrypton;

import javafx.application.Application;
import javafx.stage.Stage;
import net.findkrypton.event.HelpMouseEvent;
import net.findkrypton.event.HelpStateEvent;
import net.findkrypton.event.IconsStateEvent;
import net.findkrypton.event.InputEvent;
import net.findkrypton.event.LoadStateEvent;
import net.findkrypton.event.MenuStateEvent;
import net.findkrypton.event.MouseEvent;
import net.findkrypton.event.RunningInputEvent;
import net.findkrypton.event.RunningMouseEvent;
import net.findkrypton.event.RunningStateEvent;
import net.findkrypton.event.StartStateEvent;
import net.jumpengine.Manager;
import net.jumpengine.enume.GameState;
import net.jumpengine.manager.EventManager;

public class Main extends Application{

	@Override
	public void start(Stage stage) throws Exception {
		stage.setTitle("FindKryptonGold 发现氪金 v0.1 by JumpEngine");
		
		Manager.getLog().setLevel(2);
		
		EventManager event = Manager.getEventManager();
		
		event.addInputEvent(GameState.icons,new InputEvent());
		event.addMouseEvent(GameState.icons, new MouseEvent());
		event.addStateEvent(GameState.icons, new IconsStateEvent());
		
		event.addInputEvent(GameState.start,new InputEvent());
		event.addMouseEvent(GameState.start, new MouseEvent());
		event.addStateEvent(GameState.start, new StartStateEvent());
		
		event.addInputEvent(GameState.help,new InputEvent());
		event.addMouseEvent(GameState.help, new HelpMouseEvent());
		event.addStateEvent(GameState.help, new HelpStateEvent());
		
		event.addInputEvent(GameState.menu,new InputEvent());
		event.addMouseEvent(GameState.menu, new MouseEvent());
		event.addStateEvent(GameState.menu, new MenuStateEvent());
		
		RunningStateEvent runningStateEvent = new RunningStateEvent();
		event.addInputEvent(GameState.running,new RunningInputEvent());
		event.addMouseEvent(GameState.running, new RunningMouseEvent(runningStateEvent));
		event.addStateEvent(GameState.running, runningStateEvent);
		
		event.addInputEvent(GameState.load, new InputEvent());
		event.addMouseEvent(GameState.load, new MouseEvent());
		event.addStateEvent(GameState.load, new LoadStateEvent());
		
		Manager.init(stage,GameState.icons,1220,810,25);
	}
	
	public static void main(String[] args) {
		launch(args);
	}
}
